/*
 * @Author: LiZn
 * @Date: 2021-08-20 00:11:23
 * @LastEditTime: 2021-08-22 01:45:13
 * @LastEditors: LiZn
 * @Description: file content
 * @FilePath: \todaynews\src\store\index.js
 */
import Vue from 'vue'
import Vuex from 'vuex'
import user from './user'
import permission from './permission'
Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    homeTop: 0,
    newsTop: 0,
    myScrollTop: 0,
  },
  getters: {
    roles: state => state.user.roles,
    userToken: state => state.user.userToken,
    permisson_routes: state => state.permission.rules,
    routesPath: state => state.permission.routesPath,
    userInfos: state => state.user.userInfos
  },
  mutations: {
    setIncludes(state, setTop) {
      state.homeTop = setTop
    },
    setNewsHeight(state, setTop) {
      state.newsTop = setTop
    },
    setMyScroll(state, setTop) {
      state.myScrollTop = setTop
    }
  },
  actions: {
  },
  modules: {
    user, permission
  }
})
